<?php

/**
 * Project: CrazyPoems
 * Author: Alexandru
// Traslate By: Christian :P
 * Date: 20/10/2008
 * File: index.php
 */

// Load default settings.
require('inc/config.php');
require('inc/functions.misc.php');
require('inc/functions.index.php');

$smarty->assign('pageTitle', 'Crazypoems - ' . l('Poesía loca, entra y coloca!'));
$smarty->assign('breadcrumbs', l('Inicio'));

$poems = getPoems("", "", 10, "", "");
$poemsTo = "left";
$leftPoems = array();
$rightPoems = array();
for ($i = 0; $i < sizeof($poems); $i++) {
    if ($poemsTo == "left") {
       $leftPoems[] = $poems[$i];
       $poemsTo = "right";
    } else {
       $rightPoems[] = $poems[$i];
       $poemsTo = "left";
    }
}
$smarty->assign('leftPoems', $leftPoems);
$smarty->assign('rightPoems', $rightPoems);

$smarty->display('index.tpl');

// End page.
require('inc/end.php');
?>